<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
    <title>csgmap-detial</title>
    <style>
        html,
        body,
        #mapui {
            width: 100%;
            height: 100%;
        }
        
        html,
        body {
            margin: 0;
            padding: 0;
        }
    </style>
</head>

<body>
    <div id="mapui"></div>
    <button type="button" onclick="testFun()" style="position: absolute;top: 10px;right: 10px;">测试</button>
    <!-- <script src="./libs/psrstyle.js"></script> -->
    <script src="./js_example/script/map.min.js"></script>
    <script src="./js_example/script/psr.min.js"></script>
    <script src="./js_example/script/demo.js"></script>
    <script>
        var amap = null;
        var psrmap = null;
        var init = false;
        map.Factory.create('mapui', {
            style: style,
            center: center,
            zoom: 5,
            strategy: ['mapboxgl', 'openlayers', 'leaflet'],
        }, (o) => {
            amap = o;
            init = true;
            this.addPSR();
        });

        function testFun() {
            if (!init) {
                console.log('please waite init');
                return;
            }
        }

        function addPSR() {
            this.psrmap = new psr.PSRMap(this.amap.pmap);
            this.psrmap.addPSR([], ['Microsoft YaHei UI Regular']);
        }
        psr.Identify.connect();
        var detail = new psr.PSRDetail();

        function testFun() {
            let param = {
                id: 358220381392000,
                classid: 110
            }
            detail.getDetail(param, function(data) {
                console.log(JSON.parse(data))
            });
        }
    </script>
</body>

</html>